'use strict';

module.exports = app => {
  const {
    mongoose,
    mongoose: { Schema },
  } = app;
  const personSchema = new Schema({
    name: {
      type: Schema.Types.String,
      required: true,
    },
    sex: {
      type: Schema.Types.Boolean,
      default: true,
    },
    created_time: {
      type: Schema.Types.Date,
      default: new Date(),
    },
    updated_time: {
      type: Schema.Types.Date,
      default: new Date(),
    },
  });
  return mongoose.model('Person', personSchema);
};
